public class Hahe {
    public static void main(String[] args) {
        int[] arr = new int[101];
        int people = 100;
        int num = 3;
        int count = 0;
        int k = 0;
        int i = 0;
        int [] arr2 = new int[100];
        int m = 0;
        while(count != people) {
            i++;
            if(i > people) {
                i = 1;
            }
            if(arr[i] == 0) {
                k++;
                if (k == num) {
                    arr2[m] = i;
                    k = 0;
                    count++;
                    m++;
                }

            }
        }
        System.out.println(arr2[arr2.length-1]);
    }
}
